package com.music.user.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.music.common.core.annotation.Excel;
import com.music.common.core.web.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.beans.factory.annotation.Value;

import java.util.Date;

/**
 * 用户列表对象 pp_user
 *
 * @author ruoyi
 * @date 2024-10-22
 */
public class User extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 用户id
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long userId;

    /**
     * 头像
     */
    @Excel(name = "头像")
    private String userAvatar;

    /**
     * 昵称
     */
    @Excel(name = "昵称")
    private String userName;

    /**
     * 账户号
     */
    @Excel(name = "账户号")
    private String userAccount;

    /**
     * 密码
     */
    @Excel(name = "密码")
    private String userPassword;

    /**
     * 用户类型
     */
    @Excel(name = "用户类型")
    @Value("2")
    private Integer userType;

    /**
     * 用户号状态
     */
    @Excel(name = "用户状态")
    @Value("1")
    private Integer userStatus;

    /**
     * 省
     */
    @Excel(name = "省")
    private Integer userProvince;

    /**
     * 市
     */
    @Excel(name = "市")
    private Integer userCity;

    /**
     * 地区
     */
    @Excel(name = "地区")
    private Integer userRegion;

    /**
     * 详细地址
     */
    @Excel(name = "详细地址")
    private String userAddress;

    /**
     * 手机号
     */
    @Excel(name = "手机号")
    private String userPhone;

    /**
     * 性别
     */
    @Excel(name = "性别")
    private Integer userGender;

    /**
     * 根据生日计算年龄
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "根据生日计算年龄", width = 30, dateFormat = "yyyy-MM-dd")
    private Date userBirthday;

    /**
     * 备注
     */
    @Excel(name = "备注")
    private String userRemark;

    public User() {
    }

    public User(String userAccount) {
        this.userAccount = userAccount;
    }

    public User(String userAccount, String userPassword) {
        this.userAccount = userAccount;
        this.userPassword = userPassword;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserAvatar(String userAvatar) {
        this.userAvatar = userAvatar;
    }

    public String getUserAvatar() {
        return userAvatar;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserAccount(String userAccount) {
        this.userAccount = userAccount;
    }

    public String getUserAccount() {
        return userAccount;
    }

    public void setUserPassword(String userPassword) {
        this.userPassword = userPassword;
    }

    public String getUserPassword() {
        return userPassword;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserStatus(Integer userStatus) {
        this.userStatus = userStatus;
    }

    public Integer getUserStatus() {
        return userStatus;
    }

    public void setUserProvince(Integer userProvince) {
        this.userProvince = userProvince;
    }

    public Integer getUserProvince() {
        return userProvince;
    }

    public void setUserCity(Integer userCity) {
        this.userCity = userCity;
    }

    public Integer getUserCity() {
        return userCity;
    }

    public void setUserRegion(Integer userRegion) {
        this.userRegion = userRegion;
    }

    public Integer getUserRegion() {
        return userRegion;
    }

    public void setUserAddress(String userAddress) {
        this.userAddress = userAddress;
    }

    public String getUserAddress() {
        return userAddress;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    public String getUserPhone() {
        return userPhone;
    }

    public void setUserGender(Integer userGender) {
        this.userGender = userGender;
    }

    public Integer getUserGender() {
        return userGender;
    }

    public void setUserBirthday(Date userBirthday) {
        this.userBirthday = userBirthday;
    }

    public Date getUserBirthday() {
        return userBirthday;
    }

    public void setUserRemark(String userRemark) {
        this.userRemark = userRemark;
    }

    public String getUserRemark() {
        return userRemark;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("userId", getUserId())
                .append("userAvatar", getUserAvatar())
                .append("userName", getUserName())
                .append("userAccount", getUserAccount())
                .append("userPassword", getUserPassword())
                .append("userType", getUserType())
                .append("userStatus", getUserStatus())
                .append("userProvince", getUserProvince())
                .append("userCity", getUserCity())
                .append("userRegion", getUserRegion())
                .append("userAddress", getUserAddress())
                .append("userPhone", getUserPhone())
                .append("userGender", getUserGender())
                .append("userBirthday", getUserBirthday())
                .append("userRemark", getUserRemark())
                .toString();
    }
}
